﻿using System.Windows;
using TianlalaHSB.Models;
using TianlalaHSB.ViewModels;

namespace TianlalaHSB.Views;

/// <summary>
///     AccountDetailView.xaml 的交互逻辑
/// </summary>
public partial class AccountDetailView : Window
{
    private bool _isDetailWindowShown;

    public AccountDetailView(Account data)
    {
        InitializeComponent();
        DataContext = new AccountViewModel(data);
    }

    public void ShowWindow()
    {
        if (_isDetailWindowShown) return;
        _isDetailWindowShown = true;
        ShowDialog();
    }

    private void CloseWindow(object sender, RoutedEventArgs e)
    {
        Close();
    }
}